We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

$metaData->getDataTypes($robot); return array of integers

Hi,

$metaData->getDataTypes($robot); return array of integers

so I was wondering how to map the integers returned by the getAttributes function with Database structure:

0 = integer

1 = ?

2 = ?

and so on

Hi,

datatypes uses these constants :

https://docs.phalcon.io/fr/latest/api/Phalcon_Db_Column.html#constants

integer TYPE_INTEGER

integer TYPE_DATE

integer TYPE_VARCHAR

integer TYPE_DECIMAL

integer TYPE_DATETIME

integer TYPE_CHAR

integer TYPE_TEXT

integer TYPE_FLOAT

integer TYPE_BOOLEAN

integer TYPE_DOUBLE



43.9k

Hi, thank you

print_r($metaData->getDataTypes($actor));

Outputs: Array ( [actor_id] => 0 [first_name] => 2 [last_name] => 2 [last_update] => 2 )

So does this mean that:

integer TYPE_INTEGER (=0?)

integer TYPE_DATE (=1?)

integer TYPE_VARCHAR (=2?)

integer TYPE_DECIMAL

integer TYPE_DATETIME

integer TYPE_CHAR

integer TYPE_TEXT

integer TYPE_FLOAT

integer TYPE_BOOLEAN (=8?)

integer TYPE_DOUBLE



43.9k

Thanks man !